<%@ page import="net.amsoft.iservice.isso.hibernate.IBroker" %>
<%@ page import="net.amsoft.iservice.isso.service.ISSOService" %>
<%@ page import="net.amsoft.iservice.isso.webapp.dataObject.LoginData" %>
<%@ include file="base.jsp" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%
	// Service URLs
	String contactURL = "#";
	String forwardingURL = "#";
	
	// Get IBroker Data
	IBroker oIBroker = ISSOService.getIBroker(request.getServerName());

	// Get loggedInSynonym
	LoginData oData = (LoginData) session.getAttribute(ISSOConstants.SESSION_LOGIN_OBJ);
	if ((oIBroker!=null) && (oData!=null))
	{
		contactURL = oIBroker.getContactURL() + oData.getLoggedInSynonym();
		forwardingURL = oIBroker.getForwardingURL() + oData.getLoggedInSynonym();
	}

%>

<html>
<head>
<script src="js/help.js"></script>

<SCRIPT LANGUAGE="JavaScript">
	<!--
		
	function disable()
    {
    	if(document.ConfigForm["changePassword"].checked == true)
    	{
    		document.ConfigForm["oldPassword"].disabled = false;
    		document.ConfigForm["newPassword"].disabled = false;
    		document.ConfigForm["confirmPassword"].disabled = false;
    	}
    	else
    	{
	    	document.ConfigForm["oldPassword"].disabled = true;
    		document.ConfigForm["newPassword"].disabled = true;
    		document.ConfigForm["confirmPassword"].disabled = true;
    	}
    }
    
	function disableAnswer()
	{
   		document.ConfigForm["challengeAnswer"].disabled = !document.ConfigForm["changeAnswer"].checked;
   		document.ConfigForm["challengeQuestion"].disabled = !document.ConfigForm["changeAnswer"].checked;
	}

    function submitForm(btName)
    {
    	document.ConfigForm.step.value=btName;
    	document.ConfigForm.submit();
    }

	function submitLogoutForm(btName)
    {
		document.LogoutForm.action.value=btName;
    	document.LogoutForm.submit();
	}
	//-->
	</SCRIPT>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title><bean:message key="title.configure" /></title>
<link rel="stylesheet" type="text/css" href="styleSheets/iservices.css" />
</head>
<body onload="disable();disableAnswer();">
<center>
<table cellspacing=25 border=0 cellpadding=0>
	<%@ include file="leftMenu.jsp" %>
		<td width=605 valign=top colspan="2">
		<html:form action="/Config" method="post">
			<table width=605 border=0 cellspacing=0 cellpadding=0 >
<tr><td align="left" height="23px" valign="bottom"><img src="<%=imagePath%>/tab-click-isso.jpg" border="0" height="23px" onmouseover="this.src='<%=imagePath%>/tab-rollover-isso.jpg'" onmouseout="this.src='<%=imagePath%>/tab-click-isso.jpg'" /><a href="<%=contactURL%>"><img src="<%=imagePath%>/tab-noclick-contact.jpg" border="0" height="23px" onmouseover="this.src='<%=imagePath%>/tab-rollover-contact.jpg'" onmouseout="this.src='<%=imagePath%>/tab-noclick-contact.jpg'" /></a><a href="<%=forwardingURL%>"><img src="<%=imagePath%>/tab-noclick-forwarding.jpg" border="0" height="23px" onmouseover="this.src='<%=imagePath%>/tab-rollover-forwarding.jpg'" onmouseout="this.src='<%=imagePath%>/tab-noclick-forwarding.jpg'" /></a></td></tr>
				<tr>
					<td align="left" valign="top">
					<table width=605 border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
						<tr height="10">
							<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
							<td width="585" bgcolor="#999999" valign="top">
								<table height="45">
									<tr height="45">
										<td width="500" bgcolor="#999999" valign="middle" height="45">
											<img src="<%=imagePath%>/title_isso_configure.gif" />
										</td>
										<td width="85" bgcolor="#999999" valign="middle">
								  			<a href="#">
								  				<img border="0" src="<%=imagePath%>/button-logout.jpg" 
								  				onclick="submitLogoutForm('logout');" alt="Logout" align="right" />
											</a>	
										</td>
									</tr>
								</table>
							</td>
							<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						</tr>						
						<tr >
							<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
							<td width="585" >
								<table border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC" align="center">
									<tr>
										<td class="blue-smalltext" colspan="2">&nbsp;&nbsp;<b><html:errors /></b></td>
									</tr>
									<tr>
										<td colspan=2 height="27px" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.mandatory.fields" /></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.firstName" /></td>
										<td height="27px" class="black-smalltext"><html:text
											maxlength="255" size="20" name="ConfigForm" property="firstName"
											styleClass="textbox"></html:text></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.lastName" /></td>
										<td height="27px" class="black-smalltext"><html:text
											maxlength="255" size="20" name="ConfigForm" property="lastName"
											styleClass="textbox" /></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.personalizedGreeting" /><a class="link-nounderline blue-xsmalltext" 
											onmouseover="showHelp('<bean:message key='label.help.personalgreetingtitle'/>', '<bean:message key='label.help.personalgreetingmsg' />');" >  <img border="0" src="<%=imagePath%>/help-bullet.jpg" /></a></td>
										<td height="27px" class="black-smalltext"><html:text
											maxlength="180" size="20" name="ConfigForm" property="greeting"
											styleClass="textbox" /></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.email" /></td>
										<td height="27px" class="black-smalltext"><html:text
											maxlength="255" size="20" name="ConfigForm"
											property="emailAddress" styleClass="textbox" /></td>
									</tr>
									<tr>
										<td height="8px" colspan="4" valign="bottom"><img height="2px"
											width="100%" src="<%=imagePath%>/dotted-line.gif" /></td>
									</tr>
									<tr>
										<td height="8px" colspan="2"></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext" NOWRAP>&nbsp;&nbsp;<bean:message
											key="label.changePassword" /></td>
										<td height="27px" class="black-smalltext" ><html:checkbox
											property="changePassword" value="true"
											onclick="javascript:disable();" styleClass="black-smalltext" /></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.oldPassword" /></td>
										<td height="27px" class="black-smalltext"><html:password
											maxlength="20" size="20" property="oldPassword"
											styleClass="textbox" /></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.newPassword" /><br><b 
											class="blue-xsmalltext">&nbsp;&nbsp;&nbsp;<bean:message
											key="label.min.max.limit" arg0="4" arg1="20" /></b></td>
										<td height="27px" class="black-smalltext"><html:password
											maxlength="20" size="20" property="newPassword"
											styleClass="textbox" /></td>
									</tr>
									<tr>
										<td height="27px" width="150" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.confirmPassword" /></td>
										<td height="27px" class="black-smalltext"><html:password
											maxlength="20" size="20" property="confirmPassword"
											styleClass="textbox" /></td>
									</tr>
									<tr>
										<td height="8px" colspan="4" valign="bottom"><img height="2px"
											width="100%" src="<%=imagePath%>/dotted-line.gif" /></td>
									</tr>
									<tr>
										<td height="8px" colspan="2"></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext" colspan="2">&nbsp;&nbsp;<bean:message
											key="label.changeAnswer" />	<html:checkbox property="changeAnswer" value="true"
											onclick="javascript:disableAnswer();" styleClass="black-smalltext" /></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext" colspan="2">&nbsp;&nbsp;<bean:message
											key="label.challengeQuestion" /></td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext" colspan="2">&nbsp;&nbsp;
										<html:select property="challengeQuestion" name="ConfigForm"
											styleClass="black-smalltext">
											<html:options collection="ChallengeQuestions" property="value"
												labelProperty="label" styleClass="black-smalltext" />
										</html:select> <br />
										</td>
									</tr>
									<tr>
										<td height="27px" class="black-smalltext">&nbsp;&nbsp;<bean:message
											key="label.challengeAnswer" /><br><b 
											class="blue-xsmalltext">&nbsp;&nbsp;&nbsp;<bean:message
											key="label.min.max.limit" arg0="2" arg1="20" /></b></td>
										<td height="27px" class="black-smalltext"><html:text
											disabled="true" property="challengeAnswer" size="20"
											maxlength="20" styleClass="textbox" /></td>
									</tr>
									<tr>
										<td height="12px" colspan="2"></td>
									</tr>
									<tr>
										<td></td>
									</tr>
									<tr>
										<html:hidden name="ConfigForm" property="dupChallengeQuestion" />
										<html:hidden property="step" value="cancel" />
										<td height="20px" class="black-smalltext">&nbsp; 
											<a class="link-nounderline" href="#" > 
												<img border="0" src="<%=imagePath%>/button-submit.jpg" 
													onclick="submitForm('save');" alt="save" /> 
											</a>
										</td>
										<td height="20px" class="black-smalltext">
											<a class="link-nounderline" href="#" > 
												<img border="0" src="<%=imagePath%>/button-cancel.jpg" 
													onclick="submitForm('cancel');" alt="cancel"/> 
											</a>
										</td>
									</tr>
									<tr>
										<td class="blue-smalltext" colspan="2">&nbsp;&nbsp;</td>
									</tr>
								</table>
							</td>
							<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						</tr>						
						<tr height="10">
							<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
							<td width="585" bgcolor="#999999"></td>
							<td width="10" bgcolor="#999999"><img src="<%=imagePath%>/grey-square.gif"></td>
						</tr>						
					</table>
					</td>
				</tr>
			</table>
		</html:form>
		<form name="helpForm">
			<input name='imagePath' type='hidden' value='<%=imagePath%>' />
			<DIV id="help" class="helpbox"></DIV>
		</form>
		</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td colspan=2><font class="black-xsmalltext"></font></td>
	</tr>
</table>
</center>
<form action="/isso/Logout" name="LogoutForm" method="post">
	<INPUT type="hidden" name="action"/>
	<INPUT type="hidden" name='<%=ISSOConstants.REQ_PARAM_SPXRI%>'  value='<%=request.getAttribute(ISSOConstants.REQ_PARAM_SPXRI)%>'/>
</form>
</body>
</html>
